import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

export type UploadResult = {
  errno: number;
  data?: {
    id: string;
    name: string;
    word: string;
    pdf: string;
  };
  message?: string;
};

export const uploadAndCheckDoc = (data?: object) => {
  return http.request<UploadResult>("post", baseUrlApi("uploadAndCheckDoc"), {
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
